﻿using System;
using System.Linq;
using LINQPad.Extensibility.DataContext;
using LINQPad.OpenAccess.Settings;

namespace LINQPad.OpenAccess.Services.Descriptors
{
    /// <summary>
    /// <see cref="IConnectionDescriptor"/>.
    /// </summary>
    public interface IConnectionDescriptor
    {
        /// <summary>
        /// Determines whether this instance is able to describe the specified connection.
        /// </summary>
        /// <param name="connectionInfo">The connection info.</param>
        /// <param name="driverSettings">The driver settings.</param>
        /// <returns>
        ///   <c>true</c> if this instance is able to describe the specified connection; otherwise, <c>false</c>.
        /// </returns>
        bool CanDescribe( IConnectionInfo connectionInfo, DriverSettings driverSettings );
        /// <summary>
        /// Describes the specified connection.
        /// </summary>
        /// <param name="connectionInfo">The connection info.</param>
        /// <param name="driverSettings">The driver settings.</param>
        /// <returns>
        /// The description.
        /// </returns>
        string Describe( IConnectionInfo connectionInfo, DriverSettings driverSettings );

        /// <summary>
        /// Gets the priority of the descriptor.
        /// </summary>
        /// <value>
        /// The priority.
        /// </value>
        int Priority { get; }
    }
}
